putProperty Method |
This method sets the value of a property in the preferences.
Syntax
preferencesID.putProperty(name, value)
or
window.preferences.putProperty(name, value)
Parameters
Parameter |
Description |
---|---|
name |
Required. String that specifies the unique name of the property created in the preferences. |
value |
Required. Variant that specifies the value attached to the property in the preferences. The value can be a string or a pointer to an XML Object. |
Return Value
No return value.
Example
The following example shows how this method is used to store data.
<!-- Declare preferences --> <div cordysType="wcp.libaray.util.Preferences" file="/cordys/wcp/mypreferences" ></div> <!-- Store text value. Declare a string variable --> var myText = "This is a test"; <!-- Store it in preferences --> window.preferences.putProperty("myText", myText); //JScript function that creates an XML Object function storeXMLPreference() { cordys.loadXMLDocument("<myXML>This is an xml test</myXML>"); //Store in preferences window.preferences.putProperty("myXML", xmlObject.documentElement); }